Carbon


FSCompareFSRefs

Header: Files.h Carbon status: Supported

Determines whether two FSRefs refer to the same file or directory.

OSErr FSCompareFSRefs (
    const FSRef *ref1, 
    const FSRef *ref2
);
Parameter descriptions
ref1

A pointer to the first FSRef to compare.

ref2

A pointer to the second FSRef to compare.

function result

A result code. If the two FSRefs refer to the same file or directory, then noErr is returned. If they refer to objects on different volumes, then diffVolErr is returned. If they refer to different files or directories on the same volume, then errFSRefsDifferent is returned. This call may return other errors, including nsvErr, fnfErr, dirNFErr, and volOffLinErr.

DISCUSSION

You must use one of the three functions FSCompareFSRefs, PBCompareFSRefsSync, or PBCompareFSRefsAsync, to compare FSRefs. It is not possible to compare the FSRef structures directly since some bytes may be uninitialized, case-insensitive text, or contain hint information.

Some volume formats may be able to tell that two FSRefs would refer to two different files or directories, without having to actually find those objects. In this case, the volume format may return errFSRefsDifferent even if one or both objects no longer exist. Similarly, if the FSRefs are for objects on different volumes, the File Manager will return diffVolErr even if one or both volumes are no longer mounted.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 9, or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)